package com.anxin.act.task.service;

import com.anxin.act.task.complete.TaskComplete;
import com.anxin.act.task.entity.ViewHiTask;
import com.anxin.act.task.entity.ViewRuTask;
import com.anxin.sys.system.utils.ConfigUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * 待办对接
 */
@Service
public class ActDockingSendFactory {

    private Map<String,Object> implMap = new HashMap<>();

    @Autowired
    ApplicationContext context;


    /**
     *
     * task:正常提交
     * addBefore:前加签提交
     * addAfter:后加签提交
     * reading:阅办提交
     * freeFlow:自由流提交
     * entrust:转签
     */
    public ActDockingSendFactory(){
        // 泛微
        implMap.put("weaver","actDockingWeaverSendService");
        // 统一代办
        implMap.put("taskunified","processPushService");
    }


    public ActDockingSend get(){
        String todoDockingVendor = ConfigUtils.get("todoDockingVendor");
        Map<String, ActDockingSend> actDockingSendMap = context.getBeansOfType(ActDockingSend.class);
        return actDockingSendMap.get(implMap.get(todoDockingVendor));
    }



}
